package Persistance;

import Model.Movie;

import java.util.ArrayList;
import java.util.Date;

public class MovieList {

    private ArrayList<Movie> movieList;

    public MovieList(){
        movieList = new ArrayList<Movie>();
        populateList();
    }

    public Movie get(int index){
        return movieList.get(index);
    }

    public int size(){
        return this.movieList.size();
    }


    private void populateList() {

        Movie movie;

        Movie movieArray[] = {
                new Movie("The Shawshank Redemption", new Date(1994,10,14), "Frank Darabont"),
                new Movie("The Godfather", new Date(1972,3,24), "Francis Ford Coppola"),
                new Movie("The Godfather: Part II", new Date(1974,12,20), "Francis Ford Coppola"),
                new Movie("Pulp Fiction", new Date(1994,10,14), "Quentin Tarantino"),
                new Movie("The Dark Knight", new Date(2008,7,18), "Christopher Nolan"),
                new Movie("12 Angry Men", new Date(1957,4,14), "Sidney Lumet"),
                new Movie("Schindler's List", new Date(1993,12,15), "Steven Spielberg"),
                new Movie("The Lord of the Rings II", new Date(2003,12,17), "Peter Jackson"),
                new Movie("Fight Club", new Date(1999,10,15), "David Fincher"),
                new Movie("Star Wars: Episode V", new Date(1980,5,21), "Irvin Kershner"),
                new Movie("The Lord of the Rings I", new Date(2001,12,19), "Peter Jackson"),
                new Movie("Inception", new Date(2010,7,16), "Christopher Nolan"),
                new Movie("Goodfellas", new Date(1990,9,19), "Martin Scorsese"),
                new Movie("Forrest Gump", new Date(1994,7,6), "Robert Zemeckis"),
                new Movie("Se7en", new Date(1995,9,22), "David Fincher"),
        };
        int ratingArray [] =  {
                9,8,7,8,9,6,8,9,5,8,6,5,9,10,7
        };

        for(int movieId=0; movieId<15; movieId++){
            movie = movieArray[movieId];
            movie.rate(ratingArray[movieId]);
            movieList.add(movie);
        }

    }


}
